package com.zhaowei.allinpay.order;

import com.zhaowei.allinpay.DemoUtils;
import com.zhaowei.allinpay.IDemoHandler;
import org.json.JSONArray;
import org.json.JSONObject;

public class SignalAgentPaySimplifyHandler implements IDemoHandler {
    @Override
    public JSONObject getRequestParams() throws Exception {
        String bizOrderNo = System.currentTimeMillis() + "dbdf";

        JSONObject payToBankCardInfo = new JSONObject();
        String bankCardBackUrl = "http://10.55.3.236:6003/test/recievePayBack.jsp";
        payToBankCardInfo.put("bankCardNo", DemoUtils.rsaEncrypt("6228481111111112222"));
        payToBankCardInfo.put("amount", 3500);
        payToBankCardInfo.put("backUrl", bankCardBackUrl);
        payToBankCardInfo.put("bankCardPro", 0L);

        JSONArray splitRuleList = new JSONArray();

        JSONArray splitRuleList1 = new JSONArray();
        JSONObject splistRule11 = new JSONObject();
        splistRule11.put("bizUserId", "test1");
        splistRule11.put("amount", 10L);
        splistRule11.put("fee", 1L);
        splistRule11.put("splitRuleList", new JSONArray());
        splitRuleList1.put(splistRule11);

        JSONObject splistRule1 = new JSONObject();
        splistRule1.put("bizUserId", "yunDemo001");
        splistRule1.put("accountSetNo", "200001");
        splistRule1.put("amount", 50);
        splistRule1.put("fee", 1L);
        splistRule1.put("remark", "aaaa");
        splistRule1.put("splitRuleList", splitRuleList1);

        splitRuleList.put(splistRule1);


        JSONObject param = new JSONObject();
        param.put("bizOrderNo", bizOrderNo);
        param.put("bizUserId", "company13");
        param.put("accountSetNo", "200001");
        param.put("backUrl", "http://122.227.225.142:23661/gateway/getPayFront.jsp");
//        param.put("payToBankCardInfo", payToBankCardInfo);
        param.put("amount", 3500);
        param.put("fee", 0);
//        param.put("splitRuleList", splitRuleList);
//        param.put("goodsType", );
//        param.put("goodsNo", );
        param.put("tradeCode", "4001");
        param.put("summary", "单笔代付");
        param.put("extendInfo", "this is extendInfo");


        return param;
    }
}
